home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2007 September / PCWSEP07.iso / Software / Full / NetObjects Fusion 9 Standard / NOF9_Full_EN.exe / data1.cab / FSI / lib / nof / Page.js < prev    next >
Encoding:
Text File  |  2005-11-16  |  6.4 KB  |  291 lines

  1. /****i* SOURCE_FILE/INFO
  2.     *
  3.     * NAME
  4.     *  Page.js
  5.     *
  6.     * USAGE
  7.     *  Part of Netobjects JavaScript Library.
  8.     *
  9.     * COPYRIGHT
  10.     *  Copyright ⌐ 2000-2005 Website Pros, Inc.
  11.     *  All Rights Reserved.
  12.     *
  13.     *  This is an unpublished work protected by Website Pros, Inc.
  14.     *  as a trade secret, and is not to be used or disclosed except as
  15.     *  expressly provided in a written license agreement executed by
  16.     *  you and Website Pros, Inc.
  17.     *
  18.     *      <copyright@websitepros.com>
  19.     *
  20.     * NOTES
  21.     *  JavaScript code.
  22.     *
  23.     *****/
  24. if (!IS.isModuleInitialized("IS.NOF.Page"))
  25. {
  26.     /****h* NOF_JavaScript_Library/NOF.Page
  27.     *
  28.     * NAME
  29.     *  NOF.Page
  30.     *
  31.     * DESCRIPTION
  32.     *  
  33.     *    External dependencies: none
  34.     ****/
  35.     
  36.     /**
  37.     * Constructor    
  38.     **/
  39.     function NOF_Page( ) {
  40.         this.__proto__ = NOF_Page.prototype;    
  41.         
  42.         this.fsiNode = null; //FSINode instance
  43.     }
  44.  
  45.     {
  46.         
  47.         // declaration member variables and constants
  48.         var member = NOF_Page.prototype;    
  49.         member.CLASS_NAME            = "NOF.Page";
  50.         
  51.         // declaration member methods
  52.         var method = NOF_Page.prototype;        
  53. /*
  54. NOF.Page(String name)
  55. NOF.Page (int uniqueId)
  56.  
  57. create()
  58. string getName()
  59. setName (String newName)
  60. string getTitle()
  61. setTitle(String newTitle) 
  62.  
  63.     getSite() 
  64. int     getIDNumber()
  65. boolean   isStackedPage()
  66.  
  67. NOF.Layout  getLayout() 
  68.  
  69. ?? get/setBannerName(String name) 
  70. ?? get/setButtonName(String name) 
  71.  
  72.  
  73. NOF.Page  getRootPage() 
  74.  
  75. NOF.Page  getFirstChild() 
  76. NOF. Page  getParent() 
  77. NOF.Page  getNextSibling() 
  78. NOF.Page  getPreviousSibling() 
  79.  
  80. getAllComponents()  //toate de pe pagina resp
  81. getCurrentComponent() //curent de pe pagina. numai daca pagina e selectata (egal cu getCurrentComponent din site)
  82.  
  83. getAllElements // returns components and html objects and any other
  84. NOF.PageElement getDocumentElement - elementul root
  85.  
  86. NOF.PageElement  getElementById (id)
  87. NOF.PageElement  getCurrentElement ()
  88.  
  89. appendElement (NOF.PageElement)
  90. NOF.PageElement cloneElement ()
  91. removeElement
  92. hideElement / showElement ?
  93. getElementType : html object (text, image, form, etc) , component object, ???        
  94. */        
  95.         /**
  96.         * Get the name of this Page.
  97.         *
  98.         * @return Page's name
  99.         **/
  100.         method.getName = function () { 
  101.             var nName = this.fsiNode.Name;
  102.             return nName;
  103.         }
  104.         
  105.         /**
  106.         * Sets the name of this Page.
  107.         *
  108.         * @param newName name of the page
  109.         **/
  110.         method.setName = function (/*String*/ newName) { 
  111.             this.fsiNode.Name = newName;
  112.         }        
  113.  
  114.         /**
  115.         * Get the title of this Page.
  116.         *
  117.         * @return Page's title
  118.         **/
  119.         method.getTitle = function () { 
  120.             var tmp = this.fsiNode.Title;
  121.             return tmp;
  122.         }    
  123.         
  124.         /**
  125.         * Sets the title of this Page.
  126.         *
  127.         * @param nTitle title of the page
  128.         **/
  129.         method.setTitle = function (/*String*/ nTitle) { 
  130.             this.fsiNode.Title = nTitle;
  131.         }        
  132.         
  133.         /**
  134.         * Get the ID number of this Page.
  135.         *
  136.         * @return Page's ID
  137.         **/
  138.         method.getIDNumber = function () { 
  139.             var tmp = this.fsiNode.Number;
  140.             return tmp;
  141.         }    
  142.         
  143.         /**
  144.         * Indicates whether the node is a stacked page.
  145.         *
  146.         * @return true if this Page is a stacked page.
  147.         **/
  148.         method.isStackedPage = function () { 
  149.             var tmp = this.fsiNode.StackedPage;
  150.             return tmp;
  151.         }    
  152.  
  153.         /**
  154.         * Get the name to be used in banners on the page.
  155.         *
  156.         * @return bannerName
  157.         **/
  158.         method.getBannerName = function () { 
  159.             var tmp = this.fsiNode.BannerName;
  160.             return tmp;
  161.         }    
  162.         
  163.         /**
  164.         * Specifies the default name to be used in banners on the page.
  165.         *
  166.         * @param bannerName
  167.         **/
  168.         method.setBannerName = function (/*String*/ bannerName) { 
  169.             this.fsiNode.BannerName = bannerName;
  170.         }        
  171.         
  172.         /**
  173.         * Get the name to be used in navigation buttons on the page.
  174.         *
  175.         * @return buttonName
  176.         **/
  177.         method.getButtonName = function () { 
  178.             var tmp = this.fsiNode.ButtonName;
  179.             return tmp;
  180.         }    
  181.         
  182.         /**
  183.         * Specifies the default name to be used in navigation buttons on the page.
  184.         *
  185.         * @param buttonName
  186.         **/
  187.         method.setButtonName = function (/*String*/ buttonName) { 
  188.             this.fsiNode.ButtonName = buttonName;
  189.         }        
  190.         
  191.         /**
  192.         * Get the layout associated to the page.
  193.         *
  194.         * @return a NOF.Layout object corresponding to this Page
  195.         **/
  196.         method.getLayout = function () {
  197. //TODO:        implement NOF.Layout!
  198.             var tmp = new NOF.Layout();
  199.             tmp.fsiLayout = this.fsiNode.Layout;
  200.             return tmp;
  201.         }    
  202.  
  203.         /**
  204.         * Get root page (home page).
  205.         *
  206.         * @return root page (an instance of NOF.Page).
  207.         **/
  208.         method.getRootPage = function () { 
  209.             var tmp = new NOF.Page();
  210.             tmp.fsiNode = this.fsiNode.RootNode;
  211.             return tmp;
  212.         }    
  213.  
  214.         /**
  215.         * Get first child page.
  216.         *
  217.         * @return first child page (an instance of NOF.Page) or null if there are no child pages.
  218.         **/
  219.         method.getFirstChild = function () { 
  220.             var tmp = new NOF.Page();
  221.             tmp.fsiNode = this.fsiNode.FirstChild;
  222.             if (tmp.fsiNode == null) {
  223.                 return null;
  224.             }
  225.             return tmp;
  226.         }    
  227.             
  228.         /**
  229.         * Get the parent page.
  230.         *
  231.         * @return parent page (an instance of NOF.Page) or null if the calling page is the root page.
  232.         **/
  233.         method.getParent = function () { 
  234.             var tmp = new NOF.Page();
  235.             tmp.fsiNode = this.fsiNode.Parent;
  236.             if (tmp.fsiNode == null) {
  237.                 return null;
  238.             }
  239.             return tmp;
  240.         }    
  241.  
  242.         /**
  243.         * Get the next sibling page.
  244.         *
  245.         * @return the next sibling page (an instance of NOF.Page) or null if there is no next sibling page.
  246.         **/
  247.         method.getNextSibling = function () { 
  248.             var tmp = new NOF.Page();
  249.             tmp.fsiNode = this.fsiNode.NextSibling;
  250.             if (tmp.fsiNode == null) {
  251.                 return null;
  252.             }
  253.             return tmp;
  254.         }    
  255.  
  256.         /**
  257.         * Get the previous sibling page.
  258.         *
  259.         * @return the previous sibling page (an instance of NOF.Page) or null if there is no previous sibling page.
  260.         **/
  261.         method.getPreviousSibling = function () { 
  262.             var tmp = new NOF.Page();
  263.             tmp.fsiNode = this.fsiNode.PreviousSibling;
  264.             if (tmp.fsiNode == null) {
  265.                 return null;
  266.             }
  267.             return tmp;
  268.         }    
  269.         
  270.         
  271.         /**
  272.         * Creates a new node with the specified name in the current site, 
  273.         * as a child of the node object on which it is called.
  274.         * 
  275.         * @param pName new Page's name
  276.         * @return the new Page created (an instance of NOF.Page)
  277.         **/
  278.         method.createChildPage = function (/*String*/ pName) { 
  279.             if (this.fsiNode == null) {
  280.                 return null;
  281.             }
  282.             var tmp = new NOF.Page();
  283.             tmp.fsiNode = this.fsiNode.CreateNode(pName);
  284.             return tmp;
  285.         }    
  286.         
  287.             
  288.     }
  289.     
  290.     NOF.__proto__.Page = NOF_Page;
  291. }